package com.linq.cool.beauty.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.linq.cool.common.core.domain.BaseEntity;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import org.springframework.data.mongodb.core.mapping.Field;

import java.math.BigDecimal;
import java.util.Date;

/**
 * @Author: yqlin
 * @Date: 2021/2/11 01:28
 * @Description: 优惠券使用、领取历史表
 * @Version: 1.0.0
 */
@Data
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = true)
@AllArgsConstructor
@NoArgsConstructor
@TableName(value = "beauty_coupon_history")
public class BeautyCouponHistory extends BaseEntity {
    /**
     * 主键id
     */
    @JsonSerialize(using = ToStringSerializer.class)
    @TableId(value = "id", type = IdType.INPUT)
    private Long id;
    /**
     * 客户id
     */
    @JsonSerialize(using = ToStringSerializer.class)
    @Field("member_id")
    private Long memberId;
    /**
     * 卡券id
     */
    @JsonSerialize(using = ToStringSerializer.class)
    @TableField(value = "coupon_id")
    private Long couponId;

    /**
     * 使用状态：0未使用；1已使用；2已过期
     */
    @TableField(value = "use_status")
    private Integer useStatus;

    /**
     * 使用时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    @TableField(value = "use_time")
    private Date useTime;

    /**
     * 订单id
     */
    @TableField(value = "order_id")
    private Long orderId;

    /**
     * 面值
     */
    @TableField(value = "amount")
    private BigDecimal amount;

    /**
     * 最少使用金额(使用门槛)
     */
    @TableField(value = "min_point")
    private BigDecimal minPoint;
}